package com.dhy.cli;

import com.dhy.cli.command.ConfigCommand;
import com.dhy.cli.command.GenerateCommand;
import com.dhy.cli.command.ListCommand;
import lombok.Data;
import picocli.CommandLine;
import picocli.CommandLine.Command;


@Command(name = "yuzi", mixinStandardHelpOptions = true)
public class CommandExecutor implements Runnable {
    private CommandLine commandLine;
    {
        commandLine = new CommandLine(this)
                .addSubcommand(new GenerateCommand())
                .addSubcommand(new ListCommand())
                .addSubcommand(new ConfigCommand());
    }

    @Override
    public void run() {
        System.out.println("please input command,or input help to show help");
    }

    public Integer doExecute(String[] args){
        return commandLine.execute(args);
    }
}
